package com.kly.user.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.kly.user.db.dao.UserOnlineLogDao;
import com.kly.user.db.entity.UserOnlineLogEntity;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.Map;

/**
* User: linqu
* Date: 2023-08-11
* Time: 02:04:58.453
*/

@Repository
public class UserOnlineLogDaoImpl extends AbstractBaseMapper<UserOnlineLogEntity> implements UserOnlineLogDao {

    @Override
    public Integer checkOnline(String userCode, String dates) {
        Map<String, Object> params = Maps.newHashMap();
        params.put("userCode", userCode);
        params.put("dates", dates);
        return this.getSqlSession().selectOne(this.getStatement("checkOnline"), params);
    }

    @Override
    public void addUserOnlineLog() {
        this.getSqlSession().insert(this.getStatement("addUserOnlineLog"));
    }

    @Override
    public Integer removeData() {
        return this.getSqlSession().delete(this.getStatement("removeData"));
    }
}